package com.example.second.mediator;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.example.second.R;
import com.example.second.mediator.classes.ConcreteColleague1;
import com.example.second.mediator.classes.ConcreteColleague2;
import com.example.second.mediator.classes.ConcreteColleague3;
import com.example.second.mediator.classes.ConcreteMediator;

public class MediatorActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mediator);
        ConcreteMediator concreteMediator = new ConcreteMediator();

        ConcreteColleague1 concreteColleague1 = new ConcreteColleague1();
        ConcreteColleague2 concreteColleague2 = new ConcreteColleague2();
        ConcreteColleague3 concreteColleague3 = new ConcreteColleague3();

        concreteColleague1.setMediator(concreteMediator);
        concreteColleague2.setMediator(concreteMediator);
        concreteColleague3.setMediator(concreteMediator);

        concreteColleague1.send("Hello, I am concreteColleague1");
        concreteColleague3.send("..........");


    }
}